<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/18 0018
 * Time: 上午 10:05
 * 王晔
 * 骑手表 验证信息
 */
namespace app\common\validate;
use think\Validate;
class Rider extends Validate {
    protected $rule=[
        'username'=>['require','unique:rider','max:6','min:4'],
        'realname'=>['require'],
        'phone'=>['require','/^1[345678]\d{9}$/','unique:rider'],
    ];
    //验证不符返回msg
    protected $message  =   [
        'username.require'   => '用户名必须填写！',
        'username.min'   => '用户名最短4位!',
        'username.max'   => '用户名最长6位!',
        'username.unique'   => '用户名已存在!',
        'realname.require'   => '真实姓名必须填写！',
        'phone.require'   => '手机号必须填写！',
        'phone'   => '手机号格式错误,请输入正确的手机号！',
        'phone.unique'   => '手机号已存在！',

    ];
}